<?php
/**
 *
 * @author Konovalov Maxim aka ZloY max.zloy@gmail.com
 * 
 */
class Zend_View_Helper_Comments {
	public $view;
	public function comments(array $comments, $parent=0) {
		$html ='';
		foreach($comments as $comment){
			if($comment['parent'] == $parent){
				$html .= $this->view->comment($comment);
				$html .= $this->view->comments($comments, $comment['id']);
			}
		}
		return $html;
	}
	
	public function setView(Zend_View_Interface $view) {
		$this->view = $view;
	}
}